home *** CD-ROM | disk | FTP | other *** search
/ Wildcat Files 2 / The Wildcat Files 2 (Arsenal Computer).ISO / wccode / add4dos.wcc < prev    next >
Text File  |  1995-03-22  |  4KB  |  114 lines

  1. '----------------------------------------------------------------------------
  2. '
  3. '                               ADD4DOS ver 1.0
  4. '                         CyberDeck Systems Software
  5. '                         Written by Kevin Erickson
  6. '                             Fidonet 1:2613/308
  7. '
  8. '           Released into PUBLIC DOMAIN 10/9/94 All Rights released.
  9. '
  10. '
  11. '  ADD4DOS is a wccode utility that will extract all the file descriptions
  12. '  for every file *not* marked as on CD-ROM and write a batch file to add
  13. '  a 4DOS descript.ion file description for that file in the directory that
  14. '  the file exists.
  15. '
  16. '  This release is VERY slow, if you can speed it up please do. Send me a
  17. '  copy, I'd love to see how you did it.
  18. '
  19. '  There is no warranty. If it breaks your system, it's not my fault.
  20. '
  21. '  See bottom of source code for a list of known bugs.
  22. '----------------------------------------------------------------------------
  23.  
  24. Dim fRec as FileRecord
  25. dim fra as filearearecord
  26. dim descr as string*40
  27. 'Automatically trims the description to 40 characters so it fits on one line.
  28.  
  29. dim ctr as long
  30. dim null as string
  31. dim i as integer
  32.  
  33. const propchars = "\|/-"
  34. i = 1
  35. ' Sets up the spinning prompt. Remove this to speed up the program a little.
  36.  
  37. null = ""
  38. cls
  39.  
  40. Open "c:\add4dos.bat" for output as #1
  41. 'This is the batch file it writes to and runs at the end of the program.
  42. '
  43. print mid(propchars, i, 1)
  44. ' Sets up the spinning prompt. Remove this to speed up the program a little.
  45.  
  46. getfileinfo(fRec, null)
  47. 'Gets the first file record.
  48.  
  49.  if fRec.description = "" then
  50. 'If description is black it skips to the next file record.
  51.   getnextfile(frec)
  52.  end if
  53.   Do
  54.     if (fRec.Description) <> "" then
  55. 'If description is black it skips to the next file record.
  56.  
  57.     if fRec.Flags = 0x0010 then
  58. ' If this file has the the 'FILE IS ON CD-ROM' flag set it is skipped
  59.  
  60.       locate 1,1
  61.     else
  62.       locate 1,1
  63.       Print "Please wait. . . ";
  64.       locate 1, 18
  65.         i = (i mod len(propchars)) + 1
  66.         print chr(8); mid(propchars, i, 1);
  67. ' The spinning prompt. Remove this to speed up the program a little.
  68. ' Be sure to check the program flow through the if...thens if you do...
  69.  
  70.       getfilearea(fra, frec.area)
  71. ' Gets the path to the current file
  72.  
  73.       descr = frec.description
  74.       print #1, "describe ";fra.path;frec.name;" ";chr(34);descr;chr(34)
  75. ' Writes to the ADD4DOS.BAT file
  76.  
  77.     end if
  78.     end if
  79.   Loop until not(getnextfile(frec))
  80. ' Loops until the last file record
  81.  
  82. close #1
  83.  
  84. shell("c:\add4dos.bat", "c:\")
  85. 'Shells out and runs the .bat file. Comment this out and run from DOS for
  86. 'faster results
  87.  
  88. kill "c:\add4dos.bat"
  89. 'Deletes the .BAT file after execution. (Mine was 186k) <grin>
  90.  
  91. end
  92.  
  93. '-----------------------------------------------------------------------------
  94. '                   Known Bugs and/or non-fatal problems
  95. '
  96. '  ■ If a Wildcat file description has quotes in it, it makes the 4DOS
  97. '    describe command skip the description.
  98. '
  99. '  ■ If you have files on a CD-ROM, but not marked that way in the data base
  100. '    then 4DOS will try to write a DESCRIPT.ION file to the CD. A critial
  101. '    error message is generated.
  102. '
  103. '  ■ Batch file running is very slow, if you have a bat2exe program add it
  104. '    to the shell to compile the batch file before execution.
  105. '-----------------------------------------------------------------------------
  106.  
  107. '-----------------------------------------------------------------------------
  108. '                            Future plans
  109. '
  110. '  ■ I am planning on adding the ability to update new files in the upload
  111. '    directory only, that way it can be run as a short event each day after
  112. '    the inital run through the entire databse.
  113. '
  114. '-----------------------------------------------------------------------------